import React from 'react';
import {BrowserRouter as Router, Route, Redirect} from 'react-router-dom'
//导入组件
import Home from "./pages/Home"
import CityList from "./pages/CityList"

function App() {
  return (
    //配置路由
    <Router>
      <div className="App">
        {/*设置路由的重定向*/}
        <Route path='/' exact render={() => <Redirect to={'/home'}/>}/>
        <Route path='/home' component={Home}/>
        <Route path='/citylist' component={CityList}/>
      </div>
    </Router>
  );
}

export default App;
